<template>
  <el-dialog v-model="dialogVisible" title="课程二维码" width="500" :before-close="handleClose">
    <div class="qrcode">
      <QRCodeVue :value="url" :size="300" level="H" class="qr" />
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
import QRCodeVue from "qrcode.vue";
let dialogVisible = ref(false);
let url = ref("https://www.baidu.com");

function handleClose() {
  dialogVisible.value = false;
}

function open(e) {
  url.value = e;
  dialogVisible.value = true;
}

defineExpose({ open });
</script>



<style lang="scss" scoped>
.qrcode {
  width: 300px;
  margin: auto;
  .qr {
    width: 300px;
  }
}
</style>








